package jjn.carl.dp;

import java.util.Scanner;

/**
 * @author Jjn
 * @since 2023/8/26 11:06
 */
public class LeetCode392 {
    public boolean isSubsequence(String s, String t) {
        int firstIndex = 0;
        int secondIndex = 0;
        while (secondIndex < t.length() && firstIndex < s.length()) {
            if (t.charAt(secondIndex) == s.charAt(firstIndex)) {
                firstIndex++;
            }
            secondIndex++;
        }
        return firstIndex >= s.length();
    }
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        String t = scanner.next();
        boolean isSubsequence = new LeetCode392().isSubsequence(s, t);
        System.out.println(isSubsequence);
    }
}
